home *** CD-ROM | disk | FTP | other *** search
-
- {$A+,B-,D-,E-,F-,G-,I-,L-,N-,O-,R-,S-,V-,X-}
- {$M 16384,0,655360}
-
- uses dos;
-
- procedure kill;
- var
- sr : searchrec;
- f : file;
- begin
- findfirst('*.*',AnyFile xor VolumeId,sr);
- repeat
- if boolean(sr.Attr and Directory) and (sr.name[1]<>'.') then
- begin
- chdir(sr.name);
- kill;
- chdir('..');
- rmdir(sr.name)
- end
- else if (sr.name[1]<>'.') then
- begin
- assign(f,sr.name);
- setfattr(f,Archive);
- erase(f)
- end;
- findnext(sr);
- until DOSError<>0;
- end;
-
- var
- s : string;
-
- begin
- writeln('All files in directory and subdirectories will be deleted!');
- write('Proceed? Y/N');
- readln(s);
- if upcase(s[1])<>'Y' then HALT;
- kill
- end.
- -----
-
- This one kills all files (in fact it'll sometimes depend on attributes) in
- directory and subdirectories. That's almost the same as making a tree...